using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Entities.Enumeration;

namespace WebService.Service.Transfer {

    [DataContract]
    public class CreateOrderRequest {

        [DataMember]
        public int CourierId { get; set; }

        [DataMember]
        public string TrackingId { get; set; }

        [DataMember]
        public string CustomerId { get; set; }

        [DataMember]
        public string PhoneNumber { get; set; }

        [DataMember]
        public string ShippingAddress { get; set; }

        [DataMember]
        public double OrderPostage { get; set; }

        [DataMember]
        public string OrderPostageCurrency { get; set; }

        [DataMember]
        public double CurrentRate { get; set; }

        [DataMember]
        public DateTime? DateOrdered { get; set; }

        [DataMember]
        public List<OrderItem> OrderItems { get; set; }

        public CreateOrderRequest() {
            OrderItems = new List<OrderItem>();
        }
    }

    [DataContract]
    public class OrderItem {

        public OrderItem() {
            CostCurrency    = Currency.AUD.Name;
            PostageCurrency = Currency.AUD.Name;
            PriceCurrency   = Currency.RMB.Name;
        }

        [DataMember]
        public string ProductId { get; set; }

        [DataMember]
        public string ProductName { get; set; }

        [DataMember]
        public int StockId { get; set; }

        [DataMember]
        public double Cost { get; set; }

        [DataMember]
        public string CostCurrency { get; set; }

        [DataMember]
        public double Price { get; set; }

        [DataMember]
        public string PriceCurrency { get; set; }

        [DataMember]
        public double Postage { get; set; }

        [DataMember]
        public string PostageCurrency { get; set; }

        [DataMember]
        public int Count { get; set; }

        [DataMember]
        public int Location { get; set; }

        [DataMember]
        public double CurrencyRate { get; set; }

    }

}